
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/qualitytests/testmaterial/Quality_TestMaterial.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'QualityTestMaterialId',
                footer: "Foots",
                cnName: '原料质检',
                name: 'testmaterial/Quality_TestMaterial',
                url: "/Quality_TestMaterial/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([
                [
                    { title: "质检名称", required: true, field: "QualityTestMaterialName", type: "text" },
                    { title: "质检编号", required: true, field: "QualityTestMaterialCode", type: "text" }
                ],
                [
                    { title: "质检人", required: true, field: "QualityTestMaterialMen", type: "text" },
                    { title: "质检日期", field: "QualityTestMaterialData", type: "datetime" }
                ],
                [
                    { dataKey: "QualityTestMaterialSupplier", data: [], title: "供应商", required: true, field: "QualityTestMaterialSupplier", type: "select" }
                ],
                [
                    { title: "原料名称", required: true, field: "RawmanagementName", type: "text" },
                    { title: "原料编号", required: false, field: "RawmanagementBh", type: "text" }
                ],
                [
                    { dataKey: "XinghaoNamee", data: [], title: "型号", required: true, field: "XinghaoName", type: "select" },
                    { dataKey: "DanWeiNamee", data: [], title: "单位", required: true, field: "DanWeiName", type: "select" }
                ],
                [
                    { title: "原料批次号", required: true, field: "Rawmateriabatch", type: "text" },
                    { dataKey: "SizeNamee", data: [], title: "尺寸", required: true, field: "SizeName", type: "select" }
                ],

                
                
            ]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'QualityTestMaterialId',title:'原料质检主键Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ModifyID',title:'修改人Id',type:'int',sort:true,width:80,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',sort:true,width:130,align:'left'},
                       {field:'CreateID',title:'创建人Id',type:'int',sort:true,width:80,hidden:true,align:'left'},
                       {field:'Rawmateriabatch',title:'原料批次号',type:'string',width:110,require:true,align:'left'},
                       {field:'XinghaoName',title:'型号',type:'string',bind:{ key:'XinghaoNamee',data:[]},width:220,require:true,align:'left'},
                       {field:'SizeName',title:'尺寸',type:'string',bind:{ key:'SizeNamee',data:[]},width:220,require:true,align:'left'},
                       {field:'RawmanagementName',title:'原料名称',type:'string',width:220,require:true,align:'left'},
                       {field:'RawmanagementBh',title:'原料编号',type:'string',width:220,require:true,align:'left'},
                       {field:'QualityTestMaterialSupplier',title:'供应商',type:'string',bind:{ key:'QualityTestMaterialSupplier',data:[]},width:220,require:true,align:'left'},
                       {field:'QualityTestMaterialMen',title:'质检人',type:'string',width:110,require:true,align:'left'},
                       {field:'QualityTestMaterialData',title:'质检日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'QualityTestMaterialName',title:'质检名称',type:'string',width:110,require:true,align:'left'},
                       {field:'QualityTestMaterialCode',title:'质检编号',type:'string',width:110,require:true,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:130,align:'left'},
                       {field:'ModifyDate',title:'修改日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DanWeiName',title:'单位',type:'string',bind:{ key:'DanWeiNamee',data:[]},width:220,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>